@extends('layouts.admin')
@section('style')

@endsection
@section('content')
    <section class="qrcodeSection clearfix">
        <div class="qrcodeDiv">
            @if(!empty($url))
                <div class="qrcode-img box-center border-ef pd10">
                    <iframe frameborder="0" class="iframebox" width="200" height="200" scrolling="no"
                            src="{{$url}}"></iframe>
                </div>
            @endif
        </div>
    </section>
@endsection
@section('script')
    <script>
				@if(!empty($url))
		var interval = setInterval(function () {
				$.get('/payment/payment/poll?order_id={{$orderId}}', function (res) {
					if (res != 'null') {
						if (res == 'paid') {
							var type = 'success';
						} else if (res == 'canceled') {
							var type = 'warning';
						} else if (res == 'Failed') {
							var type = 'error';
						}
						utils.showAlert(res, {'sub': '', 'type': type});
						clearInterval(interval);
						window.parent.location.href = '/web/prize/index'
					}
				});
			}, 3 * 1000);
        @endif
    </script>
@endsection